<template>
    <pub-dialog class="small-dialog" v-model="show" small :title="name == 'privacy_rule' ? $t('components.pub-zc-gz.566984-00') : $t('components.pub-zc-gz.566984-0')">
      <div class="zc-container">
        <div class="zc-content-html" v-html="html"></div>
        <div class="zc-btn">
          <div class="pub-btn btn-big btn200" @click="closeFn">
            {{ $t('components.pub-zc-gz.566984-1') }}
          </div>
        </div>
      </div>
    </pub-dialog>
  </template>
  
  <script>
  import protal from "@/api/protal";
  import PubDialog from './pub-dialog.vue'
  export default {
    name: "pub-zc-gz",
    components: {
        PubDialog
    },
    data() {
      return {
        show: false,
        html: "",
        name: ''
      };
    },
    watch: {
      show(v) {
        if (v && !this.html) {
          // this.getGz();
        }
      },
    },
    methods: {
      closeFn() {
        this.$emit('close', this.name)
        this.show = false
      },
      getGz(t) {
        console.log(t)
        // register_rule注册规则
        // privacy_rule 隐私政策
        this.name = t
        protal.zcGzDetail(t || 'register_rule').then((res) => {
          if (res.data) {
            this.html = this.En ? res.data.contentEn : res.data.content;
            this.show = true
          }
        });
      },
    },
  };
  </script>
  
  <style lang="less" scoped>
  .small-dialog {
    .title {
      flex: 1 0 auto !important;
    }
  }
  .zc-container {
    padding: 40px;
    .zc-btn {
      display: flex;
      justify-content: center;
      margin-top: 20px;
    }
  }
  @media screen and (max-width: 750px) {
    .small-dialog {
      padding: 0 40rpx;
      .zc-container {
        padding: 40rpx 36rpx;
  
        .zc-btn {
          display: flex;
          justify-content: center;
          margin-top: 48rpx;
  
          .pub-btn {
            width: 280rpx;
            height: 88rpx;
            border-radius: 12rpx;
            font-size: 30rpx;
          }
        }
      }
    }
  }
  </style>
  